﻿using UnityEngine.Events;
using UnityEngine.UI;

namespace DSFramework
{
    public static class UIE
    {
        #region UGUI

        public static void SetListener(this UnityEvent uEvent, UnityAction call)
        {
            uEvent.RemoveAllListeners();
            uEvent.AddListener(call);
        }

        public static void SetListener<T>(this UnityEvent<T> uEvent, UnityAction<T> call)
        {
            uEvent.RemoveAllListeners();
            uEvent.AddListener(call);
        }

        #endregion
    }
}